<template>
  <el-link @click="goBack" :underline="false" class="back-link">
    <el-icon><ArrowLeft /></el-icon>
    返回
  </el-link>
</template>

<script setup lang="ts">
import { ArrowLeft } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'

const router = useRouter()
const goBack = () => {
  //返回刚刚的路径
  router.go(-1)
}
</script>

<style scoped>
.back-link {
  color: #aaa;
  font-size: 16px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  font-weight: 500;
  margin-right: 12px;
}
.back-link .el-icon {
  margin-right: 4px;
  font-size: 18px;
}
.back-link:hover {
  color: #d16053;
}
</style>
